/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sg.edu.nus.iss.pacman.manager.sms;

import sg.edu.nus.iss.pacman.manager.*;
import sg.edu.nus.iss.pacman.midlet.PacManScreen;
import sg.edu.nus.iss.pacman.net.sms.client.SMSClient;
import sg.edu.nus.iss.pacman.net.sms.client.SMSClientListener;

/**
 * A manager class for SMS client.
 * @author fredy
 */
public class SMSClientManager implements SMSClientListener, GameChallengeSender
{
    private PacManScreen screen;
    private SMSClient client;
    private String phoneNumber;

    /**
     * Creates a new instance of SMS client manager.
     * @param screen the screen
     * @param phoneNumber the phone number
     */
    public SMSClientManager(PacManScreen screen, String phoneNumber)
    {
        this.client = new SMSClient(this);
        this.screen = screen;
        this.phoneNumber = phoneNumber;
    }

    public void sendChallenge()
    {
        this.client.sendSMS(phoneNumber, CHALLENGE_MESSAGE);
    }

    public void sent()
    {
        screen.displayInfo("SMS sent to " + phoneNumber );
    }
}
